class BeautyItem < ActiveRecord::Base
	has_many :order_beauty_items

	after_create :gen_code

	def gen_code
	  code = rand(100000).to_s.rjust(6, "0")
  	  update_attributes(code: code)
	end
end
